<link rel="stylesheet" href="/css/admin/menu/load-styles.css" type="text/css" media="all">
<link rel="stylesheet" id="colors-css" href="/css/admin/menu/colors-fresh.css" type="text/css" media="all">
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
	ajaxurl = '/admin/menu/ajax?lang=<?php echo $this->lang;?>',
	pagenow = '#',
	typenow = '',
	adminpage = '#',
	thousandsSeparator = ' ',
	decimalPoint = '.',
	isRtl = 0;
//]]>
</script>

<script type="text/javascript" src="/js/admin/menu/load-scripts_002.js"></script>
<div style="cursor: auto;" class="wp-admin js nav-menus-php menu-max-depth-0" >
<div id="wpbody">
<div style="overflow: hidden;" id="wpbody-content">
<div class="wrap">
	<div><br /></div>
	<div id="nav-menus-frame">
	<div id="menu-settings-column" class="metabox-holder">
		<form id="nav-menu-meta" action="" class="nav-menu-meta" method="post" enctype="multipart/form-data">
			<input name="menu" id="nav-menu-meta-object-id" value="3" type="hidden">
			<input name="action" value="add-menu-item" type="hidden">
			<input id="menu-settings-column-nonce" name="menu-settings-column-nonce" value="94b7f6b8e8" type="hidden"><input name="_wp_http_referer" value="/wordpress/wp-admin/nav-menus.php" type="hidden">			
			<div id="side-sortables" class="meta-box-sortables ui-sortable">
				<!-- Danh sach cac Page -->
				<?php if(isset($this->allPages) && $this->allPages != NULL && count($this->allPages) >0 ){?>
				<div id="add-page" class="postbox ">
					<div class="handlediv" title="Hide/Show"><br></div><h3 class="hndle"><span>Pages</span></h3>
					<div class="inside">
						<div id="posttype-page" class="posttypediv">
							<div> <br /> </div>
							<div id="tabs-panel-posttype-page-most-recent" class="tabs-panel tabs-panel-active">
								<ul id="pagechecklist-most-recent" class="categorychecklist form-no-clear">
									<?php $count = 1;?>
									<?php foreach ($this->allPages as $page){?>
									<li>
										<label class="menu-item-title"><input class="menu-item-checkbox" name="menu-item[<?php echo $count;?>][menu-item-object-id]" value="<?php echo $page['id'];?>" type="checkbox"> <?php echo $page['name'];?></label>
										<input class="menu-item-title" name="menu-item[<?php echo $count;?>][menu-item-title]" value="<?php echo $page['name'];?>" type="hidden">
										<input class="menu-item-url" name="menu-item[<?php echo $count;?>][menu-item-url]" value="<?php echo $page['link'];?>" type="hidden">
										<input class="menu-item-type" name="menu-item[<?php echo $count;?>][menu-item-type]" value="page" type="hidden">
									</li>
									<?php $count++;}?>
								</ul>
							</div><!-- /.tabs-panel -->

							<p class="button-controls">
								<span class="list-controls">
									<a href="selectall=1#posttype-page" class="select-all">Select all</a>
								</span>

								<span class="add-to-menu">
									<img style="display: none;" class="waiting" src="/images/wpspin_light.gif" alt="">
									<input class="button-secondary submit-add-to-menu" value="Add to Menu" name="add-post-type-menu-item" id="submit-posttype-page" type="submit">
								</span>
							</p>

						</div><!-- /.posttypediv -->
					</div>
				</div>
				<?php }?>
				
				<!-- Danh sach cac category product -->
				<?php if(isset($this->allProduct) && $this->allProduct != NULL && count($this->allProduct) >0 ){?>
				<div id="add-category" class="postbox ">
				<div class="handlediv" title="Hide/Show"><br></div><h3 class="hndle"><span>Product Categories</span></h3>
				<div class="inside">
					<div id="taxonomy-category1" class="taxonomydiv">
						<div><br /></div>
						<div id="tabs-panel-category-pop" class="tabs-panel tabs-panel-active">
							<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
								<?php foreach ($this->allProduct as $product){?>
								<li>
									<label class="menu-item-title"><input class="menu-item-checkbox" name="menu-item[<?php echo $count;?>][menu-item-object-id]" value="<?php echo $product['id'];?>" type="checkbox"> <?php echo $product['name'];?></label>
									<input class="menu-item-title" name="menu-item[<?php echo $count;?>][menu-item-title]" value="<?php echo $product['name'];?>" type="hidden">
									<input class="menu-item-url" name="menu-item[<?php echo $count;?>][menu-item-url]" value="<?php echo $product['link'];?>" type="hidden">
									<input class="menu-item-type" name="menu-item[<?php echo $count;?>][menu-item-type]" value="cate" type="hidden">
								</li>
								<?php $count++;}?>
							</ul>
						</div><!-- /.tabs-panel -->

						<p class="button-controls">
							<span class="list-controls">
								<a href="selectall=1#taxonomy-category1" class="select-all">Select all</a>
							</span>

							<span class="add-to-menu">
								<img style="display: none;" class="waiting" src="/images/wpspin_light.gif" alt="">
								<input class="button-secondary submit-add-to-menu" value="Add to Menu" name="add-taxonomy-menu-item" id="submit-taxonomy-category1" type="submit">
							</span>
						</p>

					</div><!-- /.taxonomydiv -->
					</div>
				</div>
				<?php }?>
				
				<!-- Danh sach cac category New -->
				<?php if(isset($this->allNew) && $this->allNew != NULL && count($this->allNew) >0 ){?>
				<div id="add-category" class="postbox ">
				<div class="handlediv" title="Hide/Show"><br></div><h3 class="hndle"><span>New Categories</span></h3>
				<div class="inside">
					<div id="taxonomy-category2" class="taxonomydiv">
						<div><br /></div>
						<div id="tabs-panel-category-pop" class="tabs-panel tabs-panel-active">
							<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
								<?php foreach ($this->allNew as $new){?>
								<li>
									<label class="menu-item-title"><input class="menu-item-checkbox" name="menu-item[<?php echo $count;?>][menu-item-object-id]" value="<?php echo $new['id'];?>" type="checkbox"> <?php echo $new['name'];?></label>
									<input class="menu-item-title" name="menu-item[<?php echo $count;?>][menu-item-title]" value="<?php echo $new['name'];?>" type="hidden">
									<input class="menu-item-url" name="menu-item[<?php echo $count;?>][menu-item-url]" value="<?php echo $new['link'];?>" type="hidden">
									<input class="menu-item-type" name="menu-item[<?php echo $count;?>][menu-item-type]" value="cate" type="hidden">
								</li>
								<?php $count++;}?>
							</ul>
						</div><!-- /.tabs-panel -->

						<p class="button-controls">
							<span class="list-controls">
								<a href="#taxonomy-category2" class="select-all">Select all</a>
							</span>

							<span class="add-to-menu">
								<img style="display: none;" class="waiting" src="/images/wpspin_light.gif" alt="">
								<input class="button-secondary submit-add-to-menu" value="Add to Menu" name="add-taxonomy-menu-item" id="submit-taxonomy-category2" type="submit">
							</span>
						</p>

					</div><!-- /.taxonomydiv -->
					</div>
				</div>
				<?php }?>
				
				<!--  Danh sach cac category QA -->
				<?php if(isset($this->allQA) && $this->allQA != NULL && count($this->allQA) >0 ){?>
				<div id="add-category" class="postbox ">
				<div class="handlediv" title="Hide/Show"><br></div><h3 class="hndle"><span>QA Categories</span></h3>
				<div class="inside">
					<div id="taxonomy-category3" class="taxonomydiv">
						<div><br /></div>
						<div id="tabs-panel-category-pop" class="tabs-panel tabs-panel-active">
							<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
								<?php foreach ($this->allQA as $qa){?>
								<li>
									<label class="menu-item-title"><input class="menu-item-checkbox" name="menu-item[<?php echo $count;?>][menu-item-object-id]" value="<?php echo $qa['id'];?>" type="checkbox"> <?php echo $qa['name'];?></label>
									<input class="menu-item-title" name="menu-item[<?php echo $count;?>][menu-item-title]" value="<?php echo $qa['name'];?>" type="hidden">
									<input class="menu-item-url" name="menu-item[<?php echo $count;?>][menu-item-url]" value="<?php echo $qa['link'];?>" type="hidden">
									<input class="menu-item-type" name="menu-item[<?php echo $count;?>][menu-item-type]" value="cate" type="hidden">
								</li>
								<?php $count++;}?>
							</ul>
						</div><!-- /.tabs-panel -->

						<p class="button-controls">
							<span class="list-controls">
								<a href="#taxonomy-category3" class="select-all">Select all</a>
							</span>

							<span class="add-to-menu">
								<img style="display: none;" class="waiting" src="/images/wpspin_light.gif" alt="">
								<input class="button-secondary submit-add-to-menu" value="Add to Menu" name="add-taxonomy-menu-item" id="submit-taxonomy-category3" type="submit">
							</span>
						</p>

					</div><!-- /.taxonomydiv -->
					</div>
				</div>
				<?php }?>
								
				<!-- Phan nhap menu custom -->								
				<div id="add-custom-links" class="postbox ">
				<div class="handlediv" title="Hide/Show"><br></div><h3 class="hndle"><span>Custom Links</span></h3>
				<div class="inside">
					<div class="customlinkdiv" id="customlinkdiv">
							<input value="custom" name="menu-item[-1][menu-item-type]" type="hidden">
							<p id="menu-item-url-wrap">
								<label class="howto" for="custom-menu-item-url">
									<span>Link</span>
									<input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" class="code menu-item-textbox" value="http://" type="text" maxlength="200">
								</label>
							</p>

							<p id="menu-item-name-wrap">
								<label class="howto" for="custom-menu-item-name">
									<span>Label</span>
									<input value="Menu Item" id="custom-menu-item-name" name="menu-item[-1][menu-item-title]" class="regular-text menu-item-textbox input-with-default-title" title="Menu Item" type="text" maxlength="45">
								</label>
							</p>

						<p class="button-controls">
							<span class="add-to-menu">
								<img class="waiting" src="/images/wpspin_light.gif" alt="">
								<input class="button-secondary submit-add-to-menu" value="Add to Menu" name="add-custom-menu-item" id="submit-customlinkdiv" type="submit">
							</span>
						</p>

					</div><!-- /.customlinkdiv -->
					</div>
				</div>

			</div>		
		</form>
	</div><!-- /#menu-settings-column -->
	
	<div id="menu-management-liquid">
		<div id="menu-management">

			<div class="nav-tabs-nav"><div style="display: none;" class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>
			<div class="nav-tabs-wrapper">
				<div style="padding: 0px; margin-right: -148px; margin-left: 0px;" class="nav-tabs">
					<span class="nav-tab nav-tab-active">MainMenu</span>
				</div>
			</div>
			</div>
			<div class="menu-edit">		
				<form id="update-nav-menu" action="/admin/menu/success" method="post" enctype="multipart/form-data">
					<div id="nav-menu-header">
						<div id="submitpost" class="submitbox">
							<div class="major-publishing-actions">
								<br class="clear">
								<span>Languages: </span>
								<select onchange="window.location.href= this.options[this.selectedIndex].value">
									<option value="/admin/menu/index?lang=0" <?php if($this->lang == 0){echo 'selected';}?>>Default</option>
									<?php if(isset($this->languages)){?>
										<?php foreach ($this->languages as $lang){?>
											<option value="<?php echo '/admin/menu/index?lang='.$lang['language_id'];?>" <?php if($this->lang == $lang['language_id']){echo 'selected';}?>><?php echo $lang['name'];?></option>
										<?php }?>
									<?php }?>
								</select>
								<input type="hidden" name="current_language" value="<?php echo $this->lang;?>" />					
								<div class="publishing-action">
									<input class="button-primary menu-save" name="save_menu" value="Save Menu" type="submit" onclick="save_menu_cms()">
								</div><!-- END .publishing-action -->

							</div><!-- END .major-publishing-actions -->
						</div><!-- END #submitpost .submitbox -->
						<input name="menu" id="menu" value="3" type="hidden">
					</div><!-- END #nav-menu-header -->
					
					<div id="post-body">
						<div id="post-body-content">
							<!-- Show cac menu item -->
							<ul class="menu ui-sortable" id="menu-to-edit"> 
							<?php if(isset($this->allMenu) && count($this->allMenu) > 0){?>
								<?php foreach ($this->allMenu as $menu){?>
									<?php if($menu['type'] != 'custom'){?>
										<li style="position: relative; left: 0px; top: 0pt; margin-top: 0px;" id="menu-item-<?php echo $menu['id'];?>" class="menu-item menu-item-depth-<?php echo $menu['depth'];?> menu-item-page menu-item-edit-inactive pending">
											<dl class="menu-item-bar">
												<dt class="menu-item-handle">
													<span class="item-title"><?php echo $menu['title'];?></span>
													<span class="item-controls">
														<span class="item-type"><?php if($menu['type'] == "page"){echo 'Page';}else{echo 'Category';}?></span>
														<a class="item-edit" id="edit-<?php echo $menu['id'];?>" title="Edit Menu Item" href="#menu-item-settings-<?php echo $menu['id'];?>">Edit Menu Item</a>
													</span>
												</dt>
											</dl>
			
											<div class="menu-item-settings" id="menu-item-settings-<?php echo $menu['id'];?>">
												<p class="description description-wide">
													<label for="edit-menu-item-title-<?php echo $menu['id'];?>">
														Navigation Label<br>
														<input maxlength="45" id="edit-menu-item-title-<?php echo $menu['id'];?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $menu['id'];?>]" value="<?php echo $menu['title'];?>" type="text">
													</label>
												</p>
			
												<div class="menu-item-actions description-wide submitbox">
													<p class="link-to-original">Original: <a href="<?php echo $menu['link'];?>" target="_blank"><?php echo $menu['name'];?></a></p>
													<a class="item-delete submitdelete deletion" id="delete-<?php echo $menu['id'];?>" href="">Delete</a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $menu['id'];?>" href="">Cancel</a>
												</div>
			
												<input class="menu-item-data-db-id" name="menu-item-db-id[<?php echo $menu['id'];?>]" value="<?php echo $menu['id'];?>" type="hidden">
												<input class="menu-item-data-parent-id" name="menu-item-parent-id[<?php echo $menu['id'];?>]" value="<?php echo $menu['parent_id'];?>" type="hidden">
												<input class="menu-item-data-type" name="menu-item-type[<?php echo $menu['id'];?>]" value="<?php if($menu['type'] == "page"){echo 'page';}else{echo 'cate';}?>" type="hidden">
											</div><!-- .menu-item-settings-->
											
											<ul class="menu-item-transport"></ul>
											
										</li>									
									<?php }else{?>
										<li style="position: relative; left: 0px; top: 0pt;" id="menu-item-<?php echo $menu['id'];?>" class="menu-item menu-item-custom menu-item-edit-inactive pending menu-item-depth-<?php echo $menu['depth'];?>">
											<dl class="menu-item-bar">
												<dt class="menu-item-handle">
													<span class="item-title"><?php echo $menu['title'];?></span>
													<span class="item-controls">
														<span class="item-type">Custom</span>
														<a class="item-edit" id="edit-<?php echo $menu['id'];?>" title="Edit Menu Item" href="#menu-item-settings-<?php echo $menu['id'];?>">Edit Menu Item</a>
													</span>
												</dt>
											</dl>
			
											<div class="menu-item-settings" id="menu-item-settings-<?php echo $menu['id'];?>">
													<p class="field-url description description-wide">
														<label for="edit-menu-item-url-<?php echo $menu['id'];?>">
															Link<br>
															<input maxlength="200" id="edit-menu-item-url-<?php echo $menu['id'];?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $menu['id'];?>]" value="<?php echo $menu['link'];?>" type="text">
														</label>
													</p>
													<p class="description description-wide">
													<label for="edit-menu-item-title-<?php echo $menu['id'];?>">
														Navigation Label<br>
														<input maxlength="45" id="edit-menu-item-title-<?php echo $menu['id'];?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $menu['id'];?>]" value="<?php echo $menu['title'];?>" type="text">
													</label>
													</p>
			
			
												<div class="menu-item-actions description-wide submitbox">
													<a class="item-delete submitdelete deletion" id="delete-<?php echo $menu['id'];?>" href="">Delete</a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $menu['id'];?>" href="">Cancel</a>
												</div>
			
												<input class="menu-item-data-db-id" name="menu-item-db-id[<?php echo $menu['id'];?>]" value="<?php echo $menu['id'];?>" type="hidden">
												<input class="menu-item-data-parent-id" name="menu-item-parent-id[<?php echo $menu['id'];?>]" value="<?php echo $menu['parent_id'];?>" type="hidden">
												<input class="menu-item-data-type" name="menu-item-type[<?php echo $menu['id'];?>]" value="<?php echo $menu['type'];?>" type="hidden">
											</div><!-- .menu-item-settings-->
											<ul class="menu-item-transport"></ul>
										</li>									
									<?php }?>
								<?php }?>
							<?php }?>
							</ul>						
						</div><!-- /#post-body-content -->
					</div><!-- /#post-body -->
				</form><!-- /#update-nav-menu -->
			</div><!-- /.menu-edit -->
		</div><!-- /#menu-management -->
	</div><!-- /#menu-management-liquid -->
	</div><!-- /#nav-menus-frame -->
</div><!-- /.wrap-->


<div class="clear"></div></div><!-- wpbody-content -->
<div class="clear"></div></div><!-- wpbody -->
</div>

<script type="text/javascript" src="/js/admin/menu/load-scripts.js"></script>
<script type="text/javascript">
	function save_menu_cms(){
		var submit_form = document.getElementById('update-nav-menu');
		submit_form.submit();
	}
</script>